PLUGIN_NAME = "Ami (Barcode)"
PLUGIN_AUTHOR = "SuperSaltyGamer"
PLUGIN_DESCRIPTION = "Use [none] for releases explicitly marked as not having a barcode."
PLUGIN_VERSION = "1.0.0"
PLUGIN_API_VERSIONS = ["2.10"]
PLUGIN_LICENSE = "AGPL-3.0"

from picard.album import Album

original_album_parse_release = Album._parse_release


def override_album_parse_release(self: Album, release: dict):
	if release.get("barcode", None) == "":  # "This release does not have a barcode"
		release["barcode"] = "[none]"
	return original_album_parse_release(self, release)


Album._parse_release = override_album_parse_release
